﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TiTi.tea.Model;
using TiTi.tea.Comm;
using Newtonsoft.Json;

namespace TiTi.tea.Dto
{
    public class SpuProductDto
    {
        public long id { get; set; }
        public string name { get; set; }
        public string description { get; set; }
        public bool is_single { get; set; }
        public bool is_enableMaterial { get; set; }
        public int support_takeaway { get; set; }
        [JsonIgnore]
        public string SpecItems { get; set; }
        public List<object> specs
        {
            get
            {
                return SpecItems.FormJsonTo<List<object>>();
            }
        }
        public string image { get; set; }
        [JsonIgnore]
        public string ImageUrls { get; set; }
        public string[] images
        {
            get
            {
                return ImageUrls.Split(',');
            }
        }
        public string MaterialItems { get; set; }
        public List<object> materials
        {
            get
            {
                return MaterialItems.FormJsonTo<List<object>>();
            }
        }
        public decimal price { get; set; }

    }
}
